<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<style type="text/css">
    #d1{

    }
</style>
<body>
<div id="d1" align="center">
  <table border="1px">
      <tr>
          <td>国家</td>
          <td>金牌</td>
          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>银牌</td>
          <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>铜牌</td>
      </tr>
      <tr th:each="medal:${medal}">
          <td th:text="${medal.country}">
          <td th:text="${medal.gold}"></td><td><a th:href="@{|/add?country=${medal.country}&pai=gold|}">添加</a></td>
          <td th:text="${medal.silver}"></td> &nbsp;&nbsp;<td><a th:href="@{|/add?country=${medal.country}&pai=silver|}">添加</a></td>
          <td th:text="${medal.copper}"></td><td><a th:href="@{|/add?country=${medal.country}&pai=copper|}">添加</a></td>
      </tr>

<!--      <tr th:each="medal:${medal}">-->
<!--          <td th:each="medal.country"></td>-->
<!--          <td th:each="medal.gold"></td>-->
<!--          <td th:each="medal.silver"></td>-->
<!--          <td th:each="medal.copper"></td>-->
<!--      </tr>-->
  </table>
</div>
</body>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>

        // $.ajax({
        //     url:"getMedalNum",
        //     type: "post",
        //     dataType: "json",
        //     success:function (msg) {
        //
        //       for(var i=0;i<msg.length;i++){
        //          // // var ad = JSON.parse(msg);
        //          //  $("#country").value(msg.contry);
        //          //  $("#gold").value(msg.gold);
        //          //  $("#silver").value(msg.silver``);
        //          //  $("#copper").value(msg.copper);
        //       }
        //     }
        // })
        function del(id){
                $.ajax({
                    type:"post",
                    url:"[[@{/add}]]",   //  /boot5/user/delById   [[@{/user/delById}]]
                    data:{"id":id},
                    success:function(msg){
                        if(1==msg){
                            window.location.href="/user/list";
                        }
                    }
                });
        }

</script>
</html>